def make_chocolate(small, big, goal):
  if goal//5<=big and goal%5<=small:
    return goal%5
  if goal//5>big and goal-5*big<=small:
    return goal-5*big
  if goal//5>big and goal-5*big>small:
    return -1
  if goal//5<=big and goal%5>small:
    return -1